package io.geely.push.controller;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.geely.push.common.utils.R;
import io.geely.push.entity.PushDataEntity;
import io.geely.push.service.PushDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 发送数据接口
 *
 * @author qianjiang
 * @email qianjiang@geely.com
 * @date 2018-12-07 16:07:51
 */
@RestController
@RequestMapping("push")
@Api(tags="推送接口")
public class ApiPushController {
	@Autowired
	private PushDataService pushDataService;

	/**
	 * 根据当天时间请求mes的门禁信息
	 */
	@RequestMapping("/list")
	@ApiOperation("获取当天的mes门禁信息")
	public R list() {
		List<PushDataEntity> list = pushDataService.queryBydate();
		return R.ok().put("list", list).put("size", list.size()).put("getTime", new Date().getTime());
	}

}
